<!--  -->
<template>
  <div class="hbh-head">
    <div class="left">
      <img
        class="headImage"
        src="https://files.axshare.com/gsc/E0EL5C/fd/21/59/fd2159f2f7f94050a3ed7c0fb1c4079a/images/%E7%83%AD%E6%B3%B5%E7%B3%BB%E7%BB%9F/u39.png?pageId=1faa738d-2fb6-4c2f-b893-e9f972d8c348"
        alt=""
      />
      <div class="descire">
        <span>广西民族大学热泵可视化平台</span
        ><span>SMART PARK VISUAIZATION SCREEN</span>
      </div>
    </div>
    <div class="main">
      <div class="meunItem" v-for="(item, index) in routerMeun" :key="index">
        <span
          :class="{ text: true, active: item.active }"
          @click="handleTo(item)"
          >{{ item.title }}</span
        >
      </div>
    </div>
    <div class="right">
      <div class="weatherStaus">
        <!-- <svg-icon icon-class="weather" /> -->
        <img
          src="https://files.axshare.com/gsc/E0EL5C/fd/21/59/fd2159f2f7f94050a3ed7c0fb1c4079a/images/%E7%83%AD%E6%B3%B5%E7%B3%BB%E7%BB%9F/u13.png?pageId=1faa738d-2fb6-4c2f-b893-e9f972d8c348"
          alt=""
        />
      </div>
      <div class="weather"><span>20~28℃</span><span>晴转多云 优</span></div>
      <div class="clock">
        <!-- <svg-icon icon-class="calock" /> -->
        <img
          src="https://files.axshare.com/gsc/E0EL5C/fd/21/59/fd2159f2f7f94050a3ed7c0fb1c4079a/images/%E7%83%AD%E6%B3%B5%E7%B3%BB%E7%BB%9F/u28.png?pageId=1faa738d-2fb6-4c2f-b893-e9f972d8c348"
          alt=""
        />
      </div>
      <div class="currentTime">
        <span>15:32:55</span><span>2024/03/07 星期四</span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  //import引入的组件需要注入到对象中才能使用
  name: "hbhtophead",
  components: {},
  data() {
    //这里存放数据
    return {
      routerMeun: [
        {
          title: "综合态势",
          // path: "/layout/synthesize",
          path: "",
          active: false,
        },
        {
          title: "热泵系统",
          path: "/layout/home",
          active: true,
        },
        {
          title: "热水系统",
          path: "/layout/hotwater",
          active: false,
        },
        {
          title: "耗能管理",
          path: "",
          active: false,
        },
      ],
    };
  },
  //监听属性 类似于data概念
  computed: {},
  //监控data中的数据变化
  watch: {},
  //方法集合
  methods: {
    handleTo(item) {
      if (item.path) {
        this.$router.push(item.path);
      } else {
        return;
      }
      if (item.active) {
        return;
      }
      this.routerMeun.forEach((element) => {
        element.active = false;
      });
      item.active = true;
    },
  },
  //生命周期 - 创建完成（可以访问当前this实例）
  created() {},
  //生命周期 - 挂载完成（可以访问DOM元素）
  mounted() {},
  beforeCreate() {}, //生命周期 - 创建之前
  beforeMount() {}, //生命周期 - 挂载之前
  beforeUpdate() {}, //生命周期 - 更新之前
  updated() {}, //生命周期 - 更新之后
  beforeDestroy() {}, //生命周期 - 销毁之前
  destroyed() {}, //生命周期 - 销毁完成
  activated() {}, //如果页面有keep-alive缓存功能，这个函数会触发
};
</script>
<style lang="scss" scoped>
//@import url(); 引入公共css类
.hbh-head {
  width: 100%;
  height: 100%;
  background: linear-gradient(to right, #436f78 10%, #151b24 30%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  // box-shadow: 0px 0px 5px 5px #898b8e;
  // box-sizing: border-box;
  .currentTime {
    display: flex;
    flex-direction: column;
    color: #d8f0fc;
    span:nth-of-type(1) {
      font-size: 20px;
      font-weight: bolder;
    }
    span:nth-of-type(2) {
      font-size: 14px;
    }
  }
  .right {
    width: 400px;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 10px;
    box-sizing: border-box;
    .clock {
      width: 40px;
      height: 40px;
      margin-right: 20px;
      display: flex;
      justify-content: center;
      align-items: center;
      img {
        width: 40px;
        // height: 40px;
      }
    }
    .weatherStaus {
      width: 40px;
      height: 40px;
      margin-right: 10px;
      display: flex;
      justify-content: center;
      align-items: center;
      img {
        width: 40px;
        // height: 40px;
      }
    }
    .weather {
      display: flex;
      flex-direction: column;
      margin-right: 20px;
      span:nth-of-type(1) {
        color: #fff;
        font-size: 20px;
        font-weight: bolder;
      }
      span:nth-of-type(2) {
        color: #5c879c;
        font-size: 14px;
      }
    }
  }
  .main {
    height: 100%;
    display: flex;
    overflow: hidden;
    .meunItem {
      width: 180px;
      height: 100%;
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
      .text {
        color: #d9f1fd;
        display: block;
        height: 45px;
        line-height: 45px;
        text-align: center;
        font-size: 20px;
        font-weight: 700;
        background: url("https://files.axshare.com/gsc/E0EL5C/fd/21/59/fd2159f2f7f94050a3ed7c0fb1c4079a/images/%E7%83%AD%E6%B0%B4%E7%B3%BB%E7%BB%9F/u32.png?pageId=6e294c3f-452e-4f34-a4a1-856253cf51a1")
          no-repeat;
        background-size: 100% 100%;
        background-position: bottom;
      }
      .active {
        background: url("https://files.axshare.com/gsc/E0EL5C/fd/21/59/fd2159f2f7f94050a3ed7c0fb1c4079a/images/%E7%83%AD%E6%B0%B4%E7%B3%BB%E7%BB%9F/u31.png?pageId=6e294c3f-452e-4f34-a4a1-856253cf51a1")
          no-repeat;
        background-size: 100% 100%;
        background-position: bottom;
      }
    }
  }
  .left {
    width: 450px;
    height: 100%;
    display: flex;
    align-items: center;
    box-shadow: -10px 0px 2px 2px #8fdafc;
    .headImage {
      width: 79px;
      height: 74px;
      border-radius: 50%;
      overflow: hidden;
    }
    .descire {
      width: calc(100% - 79px);
      height: 100%;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      padding: 15px 10px;
      box-sizing: border-box;
      span:nth-of-type(1) {
        color: #fff;
        font-size: 26px;
        font-weight: bolder;
        white-space: nowrap;
      }
      span:nth-of-type(2) {
        color: #5c879c;
        font-size: 18px;
        white-space: nowrap;
      }
    }
  }
}
</style>
